<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CASector.aspx.cs" Inherits="CASector" %>

<%@ Register Src="MenuSuperior.ascx" TagName="MenuSuperior" TagPrefix="uc1" %>

<%@ Register assembly="DevExpress.Web.ASPxGridView.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dxwgv" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dxe" %>
<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxTabControl" tagprefix="dxtc" %>
<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxClasses" tagprefix="dxw" %>
<%@ Register assembly="DevExpress.Web.ASPxGridView.v9.2.Export, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView.Export" tagprefix="dxwgv" %>
<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxRoundPanel" tagprefix="dxrp" %>
<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPanel" tagprefix="dxp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Chrono - Sectores</title>
    <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <uc1:MenuSuperior ID="MenuSuperior1" runat="server"/>
        
        <table align="center">
            <tr>
                <td >
                    <dxtc:ASPxPageControl ID="ASPxPageControl1" runat="server" ActiveTabIndex="0" 
                        onactivetabchanged="ASPxPageControl1_ActiveTabChanged" 
                        CssFilePath="~/App_Themes/Office2003Olive/{0}/styles.css" 
                        CssPostfix="Office2003_Olive" ImageFolder="~/App_Themes/Office2003Olive/{0}/">
                        <TabPages>
                            <dxtc:TabPage Text="Detalle">
                                <ContentCollection>
                                    <dxw:ContentControl runat="server">
                                        <br />
                                        <asp:FormView ID="fvSector" runat="server" DataSourceID="dsSector">
                                            <EditItemTemplate>
                                                <table>
                                                    <tr>
                                                        <td>
                                                            Descripcion</td>
                                                        <td>
                                                            <asp:TextBox ID="DescripcionTextBox" runat="server" 
                                                                Text='<%# Bind("Descripcion") %>' />
                                                        </td>
                                                    </tr>
                                                </table>
                                                <br />
                                                <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                                                    CommandName="Update" Text="Actualizar" />
                                                &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                                                    CausesValidation="False" CommandName="Cancel" Text="Cancelar" />
                                            </EditItemTemplate>
                                            <InsertItemTemplate>
                                                SectorBD:
                                                <asp:TextBox ID="SectorBDTextBox" runat="server" 
                                                    Text='<%# Bind("SectorBD") %>' />
                                                <br />
                                                IdSector:
                                                <asp:TextBox ID="IdSectorTextBox" runat="server" 
                                                    Text='<%# Bind("IdSector") %>' />
                                                <br />
                                                IdGerencia:
                                                <asp:TextBox ID="IdGerenciaTextBox" runat="server" 
                                                    Text='<%# Bind("IdGerencia") %>' />
                                                <br />
                                                Descripcion:
                                                <asp:TextBox ID="DescripcionTextBox" runat="server" 
                                                    Text='<%# Bind("Descripcion") %>' />
                                                <br />
                                                EstaActivo:
                                                <asp:CheckBox ID="EstaActivoCheckBox" runat="server" 
                                                    Checked='<%# Bind("EstaActivo") %>' />
                                                <br />
                                                LegajosAsociados:
                                                <asp:TextBox ID="LegajosAsociadosTextBox" runat="server" 
                                                    Text='<%# Bind("LegajosAsociados") %>' />
                                                <br />
                                                <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                                                    CommandName="Insert" Text="Insert" />
                                                &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                                                    CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                                            </InsertItemTemplate>
                                            <ItemTemplate>
                                                Sector:
                                                <asp:Label ID="DescripcionLabel" runat="server" 
                                                    Text='<%# Bind("Descripcion") %>' Font-Bold="True" />
                                            </ItemTemplate>
                                        </asp:FormView>
                                        <br />
                                        <br />
                                        <br />
                                        <asp:ObjectDataSource ID="dsSector" runat="server" SelectMethod="ObtenerPorID" 
                                            TypeName="RC.ControlAcceso.ObjetosNegocio.CA2Sector" 
                                            OldValuesParameterFormatString="original_{0}">
                                            <SelectParameters>
                                                <asp:QueryStringParameter DefaultValue="-1" Name="pIDidSector" QueryStringField="ID" 
                                                    Type="Int32" />
                                            </SelectParameters>
                                        </asp:ObjectDataSource>
                                    </dxw:ContentControl>
                                </ContentCollection>
                            </dxtc:TabPage>
                            <dxtc:TabPage Text="Personal asociado">
                                <ContentCollection>
                                    <dxw:ContentControl runat="server">
                                        <dxwgv:ASPxGridViewExporter ID="gvExport" runat="server" 
                                            GridViewID="grvLegajosAsociados">
                                        </dxwgv:ASPxGridViewExporter>
                                        <table>
                                            <tr>
                                                <td>
                                                    Exportar&nbsp; 
                                                </td>
                                                <td>
                                                    <dxe:ASPxButton ID="btnExprotarPDF" runat="server" 
                                                        CssFilePath="~/App_Themes/Office2003Olive/{0}/styles.css" 
                                                        CssPostfix="Office2003_Olive" Text="PDF" Width="50px" 
                                                        OnClick="btnExprotarPDF_Click">
                                                    </dxe:ASPxButton>
                                                </td>
                                                <td>
                                                    <dxe:ASPxButton ID="btnExportarExcel" runat="server" 
                                                        CssFilePath="~/App_Themes/Office2003Olive/{0}/styles.css" 
                                                        CssPostfix="Office2003_Olive" Text="Excel" Width="50px" 
                                                        OnClick="btnExportarExcel_Click">
                                                    </dxe:ASPxButton>
                                                </td>
                                            </tr>
                                        </table>
                                        <br />
                                        <dxwgv:ASPxGridView ID="grvLegajosAsociados" runat="server" 
                                            AutoGenerateColumns="False" 
                                            CssFilePath="~/App_Themes/Office2003Olive/{0}/styles.css" 
                                            CssPostfix="Office2003_Olive" DataSourceID="dsLegajosAsociados">
                                            <Columns>
                                                <dxwgv:GridViewDataTextColumn Caption="Legajo" FieldName="NumeroLegajo" 
                                                    VisibleIndex="0">
                                                </dxwgv:GridViewDataTextColumn>
                                                <dxwgv:GridViewDataTextColumn Caption="Nombre" FieldName="ApellidoYNombre" 
                                                    ReadOnly="True" VisibleIndex="1">
                                                </dxwgv:GridViewDataTextColumn>
                                                <dxwgv:GridViewDataDateColumn FieldName="UltimaFechaProgramada" 
                                                    VisibleIndex="2">
                                                </dxwgv:GridViewDataDateColumn>
                                            </Columns>
                                            <SettingsPager Mode="ShowAllRecords">
                                            </SettingsPager>
                                            <Images ImageFolder="~/App_Themes/Office2003Olive/{0}/">
                                                <CollapsedButton Height="12px" 
                                                    Url="~/App_Themes/Office2003Olive/GridView/gvCollapsedButton.png" 
                                                    Width="11px" />
                                                <ExpandedButton Height="12px" 
                                                    Url="~/App_Themes/Office2003Olive/GridView/gvExpandedButton.png" Width="11px" />
                                                <DetailCollapsedButton Height="12px" 
                                                    Url="~/App_Themes/Office2003Olive/GridView/gvCollapsedButton.png" 
                                                    Width="11px" />
                                                <DetailExpandedButton Height="12px" 
                                                    Url="~/App_Themes/Office2003Olive/GridView/gvExpandedButton.png" Width="11px" />
                                                <FilterRowButton Height="13px" Width="13px" />
                                            </Images>
                                            <Styles CssFilePath="~/App_Themes/Office2003Olive/{0}/styles.css" 
                                                CssPostfix="Office2003_Olive">
                                                <Header ImageSpacing="5px" SortingImageSpacing="5px">
                                                </Header>
                                                <LoadingPanel ImageSpacing="10px">
                                                </LoadingPanel>
                                            </Styles>
                                            <StylesEditors>
                                                <ProgressBar Height="25px">
                                                </ProgressBar>
                                            </StylesEditors>
                                        </dxwgv:ASPxGridView>
                                        <asp:ObjectDataSource ID="dsLegajosAsociados" runat="server" 
                                            OldValuesParameterFormatString="original_{0}" 
                                            SelectMethod="ObtenerLegajosPorSector" 
                                            TypeName="RC.ControlAcceso.ObjetosNegocio.CA2Personal">
                                            <SelectParameters>
                                                <asp:QueryStringParameter DefaultValue="-1" Name="pIdSector" 
                                                    QueryStringField="ID" Type="String" />
                                            </SelectParameters>
                                        </asp:ObjectDataSource>
                                    </dxw:ContentControl>
                                </ContentCollection>
                            </dxtc:TabPage>
                        </TabPages>
                        <LoadingPanelStyle ImageSpacing="6px">
                        </LoadingPanelStyle>
                        <ContentStyle>
                            <Border BorderColor="#758D5E" BorderStyle="Solid" BorderWidth="1px" />
                        </ContentStyle>
                    </dxtc:ASPxPageControl>
                </td>
            </tr>
        </table>
    
    </div>
    </form>
</body>
</html>
